<?php
/**
 * Created by PhpStorm.
 * User: User
 * Date: 2017/12/22
 * Time: 14:42
 */


use Kinfy\Event;

use Overtrue\Pinyin\Pinyin;

Event::addListener(Event::ON_ARTICLE_WRITE, function (&$data) {
    $pinyin = new Pinyin(); // 默认
    $data['title_abbr'] = $pinyin->abbr($data['title']);
});

